package com.bw.liuyushan.zhuangao4_weektest2.MVP.Activity;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.widget.ImageView;

import com.alibaba.android.arouter.launcher.ARouter;
import com.bw.liuyushan.mvp_lib.View.BaseActivity;
import com.bw.liuyushan.zhuangao4_weektest2.MVP.Contrack.IContrackTest;
import com.bw.liuyushan.zhuangao4_weektest2.MVP.Presenter.BasePresenterTest;
import com.bw.liuyushan.zhuangao4_weektest2.R;

/**
 * ZhuanGao4_WeekTest2
 * file name is : WelcomeActivity
 * created by Ender on 2021/8/26 17:59.
 * author : 刘雨杉
 * Describe(作用):
 */
public class WelcomeActivity extends BaseActivity<BasePresenterTest> implements IContrackTest.C_ViewTest {
    private android.widget.ImageView welcome;

    @Override
    public int bindLayout() {
        return R.layout.activity_welcome;
    }

    @Override
    public void initView() {

        welcome = (ImageView) findViewById(R.id.welcome);
    }

    @Override
    public void initDate() {
        ObjectAnimator alpha = ObjectAnimator.ofFloat(welcome, "alpha", 0, 1);
        alpha.setDuration(3000);
        alpha.start();
        alpha.addListener(new Animator.AnimatorListener() {
            @Override
            public void onAnimationStart(Animator animation) {

            }

            @Override
            public void onAnimationEnd(Animator animation) {
                ARouter.getInstance().build("/start/endFragment").navigation();
                finish();
            }

            @Override
            public void onAnimationCancel(Animator animation) {

            }

            @Override
            public void onAnimationRepeat(Animator animation) {

            }
        });

    }
}
